package com.cskaoyan.bean.vo.order;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @Author:
 * @Description:
 * @DateTime:2021/4/11 20:53
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class WxOrderHandleOption {

    Boolean cancel;

    Boolean comment;

    Boolean confirm;

    Boolean delete;

    Boolean pay;
    Boolean rebuy;

    Boolean refund;

    /**
     * 未付款  → 去付款，取消订单
     * @return
     */
    public static WxOrderHandleOption unpay(){
        WxOrderHandleOption handleOption = new WxOrderHandleOption();
        handleOption.setPay(true);
        handleOption.setCancel(true);
        return handleOption;
    }

    /**
     * 未收货  → 确认收货，退款（不能取消订单）
     * @return
     */
    public static WxOrderHandleOption unreceive(){
        WxOrderHandleOption handleOption = new WxOrderHandleOption();
        handleOption.setConfirm(true);
        handleOption.setRefund(true);
        return handleOption;
    }

    /**
     * 未发货  → 退款（不能取消订单）
     * @return
     */
    public static WxOrderHandleOption unship(){
        WxOrderHandleOption handleOption = new WxOrderHandleOption();
        handleOption.setRefund(true);
        return handleOption;
    }

    /**
     * 已收货未评论  → 再次购买，评价，删除订单
     * @return
     */
    public static WxOrderHandleOption uncommentAndReceive(){
        WxOrderHandleOption handleOption = new WxOrderHandleOption();
        handleOption.setComment(true);
        handleOption.setDelete(true);
        handleOption.setRebuy(true);
        return handleOption;
    }

    /**
     * 已收货已评论  → 再次购买，评价，删除订单
     * @return
     */
    public static WxOrderHandleOption commentAndReceive(){
        WxOrderHandleOption handleOption = new WxOrderHandleOption();
        handleOption.setDelete(true);
        handleOption.setRebuy(true);
        return handleOption;
    }

    /**
     * 102,103,203
     * @return
     */
    public static WxOrderHandleOption cancelledOrRefund(){
        WxOrderHandleOption handleOption = new WxOrderHandleOption();
        handleOption.setDelete(true);
        return handleOption;
    }

}


